<?php

  $noSeasonChange = true;
  include_once("includes/header.php");
  $newsItems = array();
  $rs = executeQuery("select date_format(news_date, '%b %e %Y'), news_type, news from news order by news_date desc LIMIT 0, 6");
  while($row = mysql_fetch_row($rs)) {
    array_push($newsItems, $row);
  }
echo <<< EOQ
      <tr>
        <td>
          <center><h1>Sydney League Of Blood Bowl</h1></center><br /><br />
          <p>Welcome to SLOBB, a Sydney based Blood Bowl league for avid coaches with plenty of real life on their plate, but a passion for Blood Bowl, and a passion to be part of an ongoing league
          <p><STRONG>Commissioner</STRONG>: James Russell-Wills (Rabid Bogscum)
<br /><STRONG>Admins</STRONG>: Richard Andrew (Virral), Ian Williams (Doubleskulls)
EOQ;
$ad = new ApprovalDao();
if ($ad->hasApprovals()) {
	echo<<< EOQ
		<h4>Match Approvals</h4>
EOQ;
    $myApprovals = $ad->findOutstandingCoachApprovals();
	$commApprovals = $ad->findOutstandingCommissionerApprovals();
	foreach ($myApprovals as $approval) {
		$match = $matches->getMatch($approval->matchId);
		$desc = $match->getDescription();
	echo<<< EOQ
		<a href="match_view.php?matchId=$approval->matchId">$desc</a><br />
EOQ;
	}
	if (count($commApprovals) > 0) {
		echo<<< EOQ
		<h4>Commissioner approvals</h4>
EOQ;
		foreach ($commApprovals as $approval) {
			$match = $matches->getMatch($approval->matchId);
			$desc = $match->getDescription();
	echo<<< EOQ
		<a href="match_view.php?matchId=$approval->matchId">$desc</a><br />
EOQ;
		}
	}
}
echo <<< EOQ
          <h4>Latest Results</h4>
EOQ;
  echoNewsMatch($teams, $races);
  foreach($newsItems as $item) {
echo <<< EOQ
          <h4>$item[0]</h4>
          <b>$item[1]</b>&nbsp;$item[2]
EOQ;
  }
echo <<< EOQ
        </td>
      </tr>
EOQ;
  include("includes/footer.php");
?>
